import request from '@/utils/request'


// 关联关系查询并保存（新版本）
export function queryBarRelationAndSave(data) {
  return request({
    url: '/wareHouse/list/barRelation/queryAndSave',
    method: 'post',
    data: data
  })
}

// 获取条码关系数据列表
export function getBarRelationList(params) {
  return request({
    url: '/wareHouse/list/barRelation/list',
    method: 'get',
    params: params
  })
}


// 删除条码关系数据
export function deleteBarRelation(curCodes) {
  return request({
    url: '/wareHouse/list/barRelation/' + curCodes,
    method: 'delete'
  })
}

// 根据父级码获取关联关系子码
export function getBarRelationChildCodes(parentCode) {
  return request({
    url: '/wareHouse/list/barRelation/children/' + encodeURIComponent(parentCode),
    method: 'get'
  })
}

// 检测追溯码级别
export function detectCodeLevel(barCode) {
  return request({
    url: '/wareHouse/list/barRelation/detectLevel/' + encodeURIComponent(barCode),
    method: 'get'
  })
}

// 调试：查看追溯码的所有相关数据
export function debugBarRelationData(barCode) {
  return request({
    url: '/wareHouse/list/barRelation/debug/' + encodeURIComponent(barCode),
    method: 'get'
  })
}
